Sentiment was hurt after market regulator Sebi directed bourses to initiate action against 331 suspected shell companies.
Investors booked profits in recent gainers
The Sensex swung over 660 points both ways on alternate bouts of selling and buying before closing the day higher by 97.39 points, or 0.28 per cent.
There were more than three losers against every gainer on BSE
Strong gains in metal, energy, auto and power shares lifted the key indices to new highs.
ICICI Bank was the top gainer in the Sensex pack, surging 4.64 per cent, followed by Axis Bank at 3.86 per cent and SBI 2.53 per cent.
The breadth, indicating the overall health of the market, turned negative from positive
Broader market outperformed with the S&P BSE Midcap index adding 0.7%, while S&P BSE Smallcap index gained 0.6%.
The broader NSE Nifty scaled a high of 10,856.55 before closing up by 55.90 points, or 0.52 per cent
This is the highest closing for both the indices since May 15.
HDFC Bank was the top loser in the Sensex pack, falling 2.99 per cent, followed by Adani Ports at 2.87 per cent.
Astronomy Photographer of the Year, an annual exhibition that showcases the world's greatest space photography, now in its 13th year, has announced its 2021 winners.
Sentiments took a hit after broader Asian markets weakened, following a renewed sell-off on Wall Street on Tuesday as energy shares dropped after crude oil prices plunged to a 13-month low amid weak earnings and US-China trade disputes, fuelling worries about economic growth
The broader NSE Nifty closed 1.25 points, or 0.01 per cent down at 10,564.05.
In the Sensex kitty, ITC turned star performer by surging 2.45 per cent, followed by NTPC rising 2.19 per cent.
Out of the 30-share Sensex pack, 21 ended lower and one remained unchanged
Sensex lost 184 points to trade at 23,878 and the Nifty has dropped 55 points to quote at 7,254.
The broader NSE Nifty dipped below the 10,200-mark to hit a low of 10,180.25 before ending at 10,195.15, down by 165 points, or 1.59 per cent.
Top losers in the Sensex pack include Bharti Airtel, Infosys, Asian Paints, RIL, Coal India, HDFC Bank, HDFC, TCS, ONGC and M&M, falling up to 3.09 per cent.
At the close, the 50-share NSE Nifty was at 8,611.15, up 19.90 points, or 0.23 per cent, after moving between 8,637.15 and 8,555.20.
The 50-share NSE Nifty too closed down 168.30 points, or 1.58 per cent, at 10,498.25 -- a level last seen on January 3 when it closed at 10,443.20.
This is its biggest single session fall since August 24, 2015, when it had lost 1,624.51 points.
Thus far in 2017-18, FIIs and MFs have invested Rs 198.91 billion and Rs 1,119.49 billion in the Indian equity markets. Of this, around Rs 152.46 billion has come in January alone.
The fall was led by L&T, IndusInd Bank, PowerGrid, NTPC, TCS, ICICI Bank, Axis Bank, Hero MotoCorp, Bharti Airtel and SBI, declining up to 2.64 per cent.
The NSE Nifty also gained 53 points, or 0.49 per cent, to settle 10,855.15 after shuttling between 10,870.40 and 10,749.40.
Tracking gains in bluechip stocks, investors were also seen building up position in broader markets, lifting the small-cap and mid-cap indices by 0.83 and 0.15 per cent
Covering-up of short positions ahead of Thursday's expiry of August series in the derivatives segment gave equities a slight push
The broader NSE Nifty index too finished lower by 4.80 points, or 0.05 per cent, at 10,632.20.
The broader NSE Nifty, after cracking below the key 10,300-mark, touched a low of 10,211.25, before finally ending 134.75 points, or 1.30 per cent, down at 10,226.55.
Reflecting the bearish mood, all sectoral indices, led by metal, teck and healthcare, ended in the negative zone.
The Nifty rose 176.50 points, or 1.74 per cent, during the week.
Market experts believe the retreat is because of uncertainty.
Investor wealth too fell by nearly Rs 7 lakh crore during 2015-16 or over Rs 2,700 crore per trading session.
Maruti Suzuki, Asian Paints, L&T, ONGC and Infosys have gained between 1%-1.5%.
The fall came on the back of a massive selloff in NBFCs, led by DHFL which skidded over 50 per cent on fears of a liquidity crisis.
China's malfunctioning stock markets remained semi-frozen.
Consequences of China's efforts to stabilise its equity markets after three weeks of declines, which wiped out some 30 per cent of the value is far more importance to the world, says Clyde Russell.
Coal India fell the most by 2.58 per cent among Sensex scrips, dragging the index into the negative zone.
Yes Bank was the top gainer in the Sensex pack, surging 3.76 per cent, followed by SBI at 3.18 per cent.
Month-end dollar demand from importers resulted in the rupee touching a new all-time low on Wednesday against the dollar.